package pro.cherish.knowledgeormmysql.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import pro.cherish.knowledgeormmysql.config.mybatis.intercepter.annotation.EtlDynamicSql;
import java.util.Map;

/**
 * @Description: 通用dao
 * @Param:
 * @return:
 * @Author: cherish
 * @Date: 2019/10/11
 */
public interface EtlGeneraDao {

    /**
     * @Description: 通过走mybatis解析最终可执行的sql
     * @Param: [sql, params]
     * @return: int
     * @Author: cherish
     * @Date: 2019/10/11
     */
    @Select(" ${sql} ")
    @EtlDynamicSql
    String buildEtlRealSql(@Param("sql") String sql, @Param("params") Map<String, Object> params);

    /**
     * @Description: 通过走mybatis解析最终可执行的sql【支持分页】
     * @Param: [page, sql, params]
     * @return: java.util.List<java.util.HashMap < java.lang.String, java.lang.Object>>
     * @Author: cherish
     * @Date: 2019/10/12
     */
    @Select(" ${sql} ")
    @EtlDynamicSql
    String buildEtlRealSql_havaPage(Page page, @Param("sql") String sql, @Param("params") Map<String, Object> params);

}
